home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / C++ AppleLink Messages / CPlus.Dev$ 6⁄29⁄90 / 0147-private member in un-Jun90 < prev    next >
Encoding:
Text File  |  1990-06-29  |  1.5 KB  |  42 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  TIM.SWIHART  to CPLUS.BUGS
  2.  
  3. Item    7909753                         27-June-90        09:20PDT
  4.  
  5. From:   D0532                           Aidea Systems, Don Park,PRT
  6.  
  7. To:     CPLUS.DEV$                      C++ Interest List--Developers
  8.         CPLUS.APPLE$                    C++ Interest List--Apple Employees
  9.  
  10. Sub:    private member in union?
  11.  
  12. Section 9.5 of the newly published Annotated C++ Reference Manual indicates
  13. that ordinary unions may have private members as well as function members.
  14. However, I found that following piece of code does not compile under MPW C++
  15. 3.1B1 translator and Zortech C++ 2.0 compiler:
  16.  
  17. union u {
  18. private:            // error:  private in union declaration
  19.     int     a;
  20. public:             // error:  public in union declaration
  21.     char *  p;
  22. };
  23.  
  24. Perhaps this feature was part of the AT&T C++ 2.1 upgrade.  I am not sure what
  25. to believe.  The C++ Reference Manual supplied with MPW C++ is desperatly vague
  26. and inaccurate.  Its section 9.5 states that "a union may have member
  27. functions" in one place and later states that "a union may not have function
  28. members."  I didn't realize there was a difference between member functions and
  29. function members.
  30.  
  31. Does anyone know what the story is?
  32.  
  33. Don Park
  34.  
  35. P.S. If you are still trying to figure out which of the millions of C++ books
  36. are good, I recommend the following:
  37.  
  38. 1.  C++ Primer by Stanley Lippman       (For examples and easy listening)
  39. 2.  The Annotated C++ Reference Manual  (For reference and good sleep)
  40. 3.  The C++ Answer Book                 (For examples)
  41.  
  42.